<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'', styles:'bootstrap,font-awesome,animate,style,bootstrap-table,layui'}){%>
    <style type="text/css">
        body{padding-top:10px;}
        *{margin:0;padding:0;list-style-type:none;}
        a,img{border:0;}
        .demo h2{font-size:16px;color:#3366cc;height:30px;}
        .demo li{float:left;}
    </style>
    <%}%>
</head>
<body>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <!-- START 右侧数据 -->
            <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                <div class="ibox-content" style="padding:15px 20px 0px 20px;">
                    <form id="search-form" role="form" class="form-inline">

                    </form>
                </div>
            </div>
            <!-- START 操作按钮 -->
            <form>
            <div id="toolbar" class="btn-group" style="margin-bottom:5px;">

                <input type="hidden" id="planId" value="${planId}">
                <a class="return-btn btn btn-sm btn-primary"><i class="fa fa-arrow-left" aria-hidden="true"></i> 返回</a>
                <a class="export-btn btn btn-sm btn-success"><i class="fa fa-plus" aria-hidden="true"></i> 导出</a>
            </div>
            </form>
            <!-- END 操作按钮 -->

            <!-- START 数据表格 -->
            <table id="relatedTable"
                   data-toolbar="#toolbar"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-resizable="true"
                   data-side-pagination="server"
                   data-url="/sea/supply/distribute/findByPlanId.do?planId=${planId}"
                   data-page-size="15"
                   class="table table-striped table-hover table-responsive"
                   >
            </table>
            <!-- END 数据表格 -->

            <!-- END 右侧数据 -->
        </div>
    </div>
</div>

<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,bootstrap-table,dtvalidate,dtvalidate-lang-zh_cn,bootstrap-table-zh-CN,laydate,layer,layui,upload'}){}%>
<script>

    var $relatedTable = $('#relatedTable'),selections=[];
    $(function(){
        //START 表格配置
        $relatedTable.bootstrapTable({
            pageSize:10,
            columns: [
                {
                    title: 'PO',
                    field: 'receiveNo',
                    align: 'center',
                    valign: 'middle'
                },{
                    title: '供应商',
                    field: 'produceSupplierName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '渠道',
                    field: 'receiveChannelName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: 'SKU',
                    field: 'receiveSku',
                    align: 'center',
                    valign: 'middle'
                },

                {
                    title: '商品名称',
                    field: 'productName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '产品名称',
                    field: 'productName',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '产品颜色',
                    field: 'productColorName',
                    align: 'center',
                    valign: 'middle'
                }, {
                    title: '尺码(CM)',
                    field: 'productCm',
                    align: 'center',
                    valign: 'middle'
                },{
                    title: '尺码(Inch)',
                    field: 'productInch',
                    align: 'center',
                    valign: 'middle'
                } ,{
                    title: '可分配数量',
                    field: 'receiveNumber',
                    align: 'center',
                    valign: 'middle'
                }, {
                    title: '预计交期',
                    field: 'orderDate',
                    align: 'center',
                    valign: 'middle'
                }, {
                    title: '合同号',
                    field: 'produceAgreement',
                    align: 'center',
                    valign: 'middle'
                }, {
                    title: '装箱量',
                    field: 'createPackage',
                    align: 'center',
                    valign: 'middle'
                }
            ],
            onLoadSuccess : function(){

            }
        });
        //END 表格配置
        //表格高度自适应
//        $(window).resize(function () {
//            $dealTable.bootstrapTable('resetView', {
//                height: getHeight()
//            });
//        });
    });


    $('.export-btn').on('click',function(){
        var id=$("#planId").val();
        window.location.href='/sea/supply/distribute/export.do?planId='+id;
    });

    //返回
    $('.return-btn').on('click',function(){
        parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭弹窗
    });


</script>
</body>
</html>
